<!-- 商品列表组件 <good-list :list="xx"></good-list> -->
<template>
	<view class="scroll-view_H">
	<view class="" v-for="good in list" :key="good.id">
		<view class="Item">
			<view class="item-link item-content">
				<view class="item-inner" @tap="stockWpAsset($event)" :data-id="good.资产编码" :data-newid="good.Id" :data-code="good.盘点状态" :data-jgcode="good.盘点结果">
					<view class="item-text">
						<view class="ispan" style="width: 83%;font-weight:bold;color:#000000">{{good.资产名称}}</view>
					</view>
					<view class="item-text">
						<view class="ispan">资产编码</view><view class="span">{{good.资产编码=="null"?"":good.资产编码}}</view>
					</view>
					<view class="item-text" style="width: 100%;">
						<view class="ispan"style="background-color: #E7F1FF;text-align: center;
						border-radius: 10rpx;
						color:#6D8AF9;height: 50rpx;line-height: 50rpx;font-weight: bold;">
						{{good.使用人=="null"?"":good.使用人}}</view>
						
						<view class="span">
						<view style="background-color: #E7F1FF;text-align: center;
						border-radius: 10rpx;
						color:#6D8AF9;height: 50rpx;line-height: 50rpx;font-weight: bold;
						padding:0 20rpx;float: left;
						">{{good.使用部门=="null"?"":good.使用部门}}</view>
						</view>

					</view>
					<view class="item-line">
						
					</view>
					<view class="item-text">
						<view class="ispan">资产类别</view><view class="span">{{good.资产类别}}</view>
					</view>					
					<view class="item-text">
						<view class="ispan">规格型号</view><view class="span">{{good.规格型号=="null"?"":good.规格型号}}</view>
					</view>
					<view class="item-text">
						<view class="ispan">资产位置</view><view class="span">{{getwz(good.资产位置)}}</view>
					</view>
					<view class="item-text">
						<view class="ispan">盘点备注</view><view class="span">{{good.盘点备注=="null"?"":good.盘点备注}}</view>
					 </view>
				</view>
			</view>  	           
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	var self;
	export default {
		props:{
			list: {
				type: Array,
				default(){
					return []
				}
			},
			currAddress:"",
			srcsys: "../../static/images/icon-sxuan.png",
		},
		onLoad() {
		},
		methods: {
			getwz(wz){
				if(wz=="null"){
					return "";
				}
				if(wz.length>8){
					return "暂无";
				}
				return wz;
			},
			stockAsset(e) {
				uni.navigateTo({
					url: '../stock/StockDocumentAsset?AssetCode=' + e.currentTarget.dataset.id+'&type=1',
				});				
			},
			stockWpAsset(e) {
				
				if(e.currentTarget.dataset.jgcode=="盘盈"){
					console.log(e.currentTarget.dataset.id);
					uni.navigateTo({
						url: '../stock/StockDocumentAssetAddDetail?Id=' + e.currentTarget.dataset.newid+'&type=1',
					});	
				}else{
					console.log(e.currentTarget.dataset.id);
					if(e.currentTarget.dataset.code=="已盘"){
						uni.navigateTo({
							url: '../stock/StockDocumentAssetDetail?AssetCode=' + e.currentTarget.dataset.id+'&type=1',
						});	
					}else{
						uni.navigateTo({
							url: '../stock/StockDocumentAssetDetail?AssetCode=' + e.currentTarget.dataset.id+'&type=0',
						});	
					}
				}
			}
		}
	}
</script>

<style >
	.item-icon-sys {
		width: 40upx;
		height: 40upx;
	}
	.scroll-view_H{
		background-color: #edf1f4;
		margin-top: 510rpx;
		padding-left: 10px;
		padding-right: 10px;
	}
	.Item {
		border: 1px solid #e6e6e6;
		overflow: hidden;
		padding-bottom: 16rpx;
		border-radius: 16rpx;
		background: #fff;
		margin-top: 10rpx;
	}
	
	.item-text .span {
		display: inline-block;
		width: 79%;
		float: right;
	}
	
	.item-text .ispan {
		font-style: normal;
		width: 18%;
		display: inline-block;
		color: #9E9CA5;
	}
	
	.item-content {
		padding-left: 0;
	}
	
	.item-title .ispan {
		font-size: 30rpx;
		width: auto;
		height: auto;
	}
	
	.item-title {
		font-size: 40rpx;
		color: #454545;
		width: 100%;
	}
	
	.item-title-row {
		background-image: none;
		padding-right: 0px;
	}
	
	.item-link .item-inner {
		padding-right: 0;
	}
	.item-text {
		font-size: 30rpx;
		color: #454545;
		margin: 20rpx 0;
		padding-left: 20rpx;
		line-height: 1.2;
	}
	
	// 选中tab的线
	.item-line{
		z-index: 1;
		
		bottom: 30rpx; // 至少与.tabs-item的padding-bottom一致,才能保证在底部边缘
		width: 1800rpx;
		height: 0.1rpx;
		transform: translateX(-50%);
		border-radius: 4rpx;
		transition: left .3s;
		background: #EFEFEF;
	}
</style>
